<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<tpl> $NCharset </tpl>" />
<link href="<tpl> $template_dir </tpl>/member/css/layout.css" rel="stylesheet" type="text/css" />
<tpl>
include file ='../head.config.html'</tpl>
<script type="text/javascript">
$().ready(function() {
	$('#icon_close_search_box').click(
		function(){ $('#filter').slideUp('slow',function(){$('#showcontr').slideDown('fast')})}
	);
	$('#showcontr').click(
		function(){ $('#showcontr').slideUp('fast',function(){$('#filter').slideDown('slow')})}
	);
	$(".tr_dotted").hover(function(){$(this).addClass("over")},function(){$(this).removeClass("over")});
	$('#negative').click(
		function(){
			$('#form_product input[@type=checkbox]').each(function(){
				$(this).attr('checked',!$(this).attr('checked'))
			})
		}
	)
	$('#offsale').click(
		function(){
			$('#form_product').attr("action", "own_product_list.php?action=update_state");
			$('#form_product').submit();
		}
	)
	$('#recommended').click(
		function(){
			$('#form_product').attr("action", "own_product_list.php?action=recommended");
			$('#form_product').submit();
		}
	)
	$('#cancel_recommended').click(
		function(){
			$('#form_product').attr("action", "own_product_list.php?action=cancel_recommended");
			$('#form_product').submit();
		}
	)

});

function update_storage(p_code){
	var storage = document.getElementById('p_storage_' + p_code).value;
	$.ajax({
    	url: 'own_product.php?action=update_count',
    	type: 'post',
    	dataType: 'msg',
		data: 'txtPcode=' + p_code + '&txtPcount=' + storage,
    	error: function(){
        	alert('something is wrong');
    	},
    	success: function(msg){
			//if(html == "ok"){
			alert('<tpl> $langProductMSaveOk </tpl>');
			window.location.reload();
			//}
        }
	});
}
</script>
</head>
<body><tpl>include file ='../header.html'</tpl> 

<div id="container761">
  <div class="own_member_main">
 <tpl>include file ='own_menu.html'</tpl>
  <div class="member_right">
<div class="new_main_left">
		<div class="new_main_left1">
	<h1 class="new_text">
		<tpl> if $state eq '0' </tpl>
			<tpl> $langProductMDepotBaby </tpl>
		<tpl> /if </tpl>
		<tpl> if $state eq '1' </tpl>
			<tpl> $langProductMSaleBaby </tpl>
		<tpl> /if </tpl>
		<tpl> if $state eq '2' </tpl>
			<tpl> $langRecommended </tpl>
		<tpl> /if </tpl>
	</h1>
 <i></i>
	</div>
	<b></b>
	</div>
	 <div id="own_main_rightop"><form action="own_product_list.php?action=<tpl> if $state eq 1 </tpl>list<tpl> /if </tpl><tpl> if $state eq 0 </tpl>listinstock<tpl> /if </tpl><tpl> if $state eq 2 </tpl>recommended_list<tpl> /if </tpl>" method="post"  name="search_form">
        <tpl> $langProductMSeeBaby </tpl>：
        <select name="searchtype">
          <option value="1" selected="selected"><tpl> $langProductMAll </tpl></option>
        </select>
        <input name="keyword" type="text" class="new_input" />
     <input style=" font:12px/1.2em '宋体'" name="" type="submit" value="<tpl> $langProductMSeeBaby </tpl>"  class="new_anniu"  />
      </form>
	  <tpl> $langPListRemark </tpl>
	  </div>
	<div id="own_main_rightop_line" style="margin-top:-3px;">
	  <b class="b4"></b>
	  <b class="b3"></b>
	  <b class="b2"></b>
	  <b class="b1"></b>
	  </div>
    <form action="own_product.php?action=del" method="post" name="form_product" id="form_product" onsubmit="if(window.confirm('<tpl> $langPConfirmDel </tpl>')){return true;}else{return false;};return false;">
	<input type="hidden" name="list_type" id="list_type" value="<tpl> if $state eq 1 </tpl>list<tpl> /if </tpl><tpl> if $state eq 0 </tpl>listinstock<tpl> /if </tpl><tpl> if $state eq 2 </tpl>recommended_list<tpl> /if </tpl>" />
      <table border="1" cellpadding="0" cellspacing="0" bordercolor="#DDE0E3" style="overflow:visible; margin-top:10px" >
	  	<tr><td colspan="10"></td></tr>
        <tr class="tr_FAFAFA">
          <th width="5%" align="center" valign="middle"><tpl> $langProductMSelect </tpl></th>
          <th width="42%" align="center" valign="middle"><tpl> $langProductMBaby </tpl>
          <tpl> $langProductMName </tpl></th>
          <th width="13%" align="center" valign="middle"><tpl> $langProductMNum </tpl></th>
          <tpl> if $product_array[0].p_state!="0" </tpl>
          <th width="13%" align="center" valign="middle"><tpl> $langProductMSpare </tpl>
          <tpl> $langProductMTime </tpl></th>
          <tpl> /if </tpl>
          <th width="12%" align="center" valign="middle" ><tpl> $langProductMNoncePrice </tpl></th>
          <th width="8%" align="center" valign="middle"><tpl> $langProductMDid </tpl><tpl> $langProductMDegree </tpl></th>
          <th width="7%" align="center" valign="middle"><tpl> $langCedit </tpl></th>
        </tr>
        <tpl> section name=i loop=$product_array </tpl>
        <tr class="tr_dotted">
          <td align="center" valign="middle">
		  	<input name="chboxPid[]" type="checkbox" value="<tpl> $product_array[i].p_code </tpl>"/>
		  	<input type="hidden" name="recommended_sign_<tpl> $smarty.section.i.rownum </tpl>" id="recommended_sign_<tpl> $smarty.section.i.rownum </tpl>" value="<tpl> $product_array[i].p_recommended </tpl>" />
			<!--  用来判断是否允许删除改商品  -->
			<input type="hidden" name="check_sign[<tpl> $product_array[i].p_code </tpl>]" value="<tpl> $product_array[i].check_sign </tpl>" />
			<!--  如果是拍卖商品，隐藏域包括商品价格，用来更新当前拍卖价格  -->
			<tpl> if $product_array[i].p_sell_type eq '0' </tpl>
				<input type="hidden" name="p_price[<tpl> $product_array[i].p_code </tpl>]" value="<tpl> $product_array[i].p_price </tpl>" />
			<tpl> /if </tpl>
		  </td>
          <td align="center" valign="middle" style="color:#FF0000; padding:8px"><tpl> if $product_array[i].p_recommended == "1" </tpl><tpl> $langCCommend </tpl><tpl> /if </tpl>
		  <tpl> if $ifhtml eq '1' && $product_array[i].html_url neq '' </tpl>
		  		<a target="_blank" href="<tpl> $product_array[i].html_url </tpl>">
				<tpl> $product_array[i].p_name </tpl></a>&nbsp;&nbsp;<span style="color:#FF9900; width:30px"><tpl> $product_array[i].p_sell_type_name </tpl></span>
		  <tpl> else </tpl>
		  		<a href="../home/product.php?action=view&pid=<tpl> $product_array[i].p_code </tpl>" target="_blank"><tpl> $product_array[i].p_name </tpl></a>&nbsp;&nbsp;<span style="color:#FF9900; width:30px"><tpl> $product_array[i].p_sell_type_name </tpl></span>
		  <tpl> /if </tpl>
		  <!-- 商品是否违规 -->
		  <tpl> if $product_array[i].p_irregularities eq '1' </tpl>
		  <tpl> $langProductIrregularities </tpl><tpl> $langProductUnder </tpl>
		  <tpl> /if </tpl>
		  </td>
          <td align="center" valign="middle">

		  <div style="width:90px; margin:0 auto">
		  	<tpl> if $product_array[i].check_sign eq 0 </tpl>
			<input style=" float:left;border:1px solid #ccc; width:30px;" name="p_storage_<tpl> $product_array[i].p_code </tpl>" id="p_storage_<tpl> $product_array[i].p_code </tpl>" value="<tpl> $product_array[i].p_storage </tpl>" />
  <!--<input name="update_count" type="button" class="new_anniu"  onclick="update_storage('<tpl> $product_array[i].p_code </tpl>');" value="<tpl> $langCsave </tpl>" />-->
  <img src="<tpl> $template_dir </tpl>/member/images/shop_bc.gif" style=" cursor:pointer;" alt="<tpl> $langCsave </tpl>" title="<tpl> $langCsave </tpl>"  onclick="update_storage('<tpl> $product_array[i].p_code </tpl>');" />
			<tpl> else </tpl>
			<tpl> $product_array[i].p_storage </tpl>
			<tpl> /if </tpl>
			<div style="clear:both"></div>
</div>
		  </td>
            <tpl> if $product_array[i].p_state!="0" </tpl>
          <td align="center" valign="middle" style=" text-align: center;"><tpl> $product_array[i].left_days </tpl><tpl> $langPday </tpl><tpl> $product_array[i].left_hours </tpl><tpl> $langPhour </tpl><tpl> $product_array[i].left_minutes </tpl><tpl> $langPminute </tpl></td>
          <tpl> /if </tpl>
          <td align="center" valign="middle" ><span class="fontred"><strong>
            <tpl> $product_array[i].p_cur_price </tpl><tpl> if $product_array[i].p_cur_price !="" </tpl><tpl> $langCYuan </tpl><tpl> /if </tpl> /</strong></span><br />
          <tpl> $product_array[i].p_price </tpl><tpl> $langCYuan </tpl></td>
          <td align="center" valign="middle" style="text-align: center;"><tpl> $product_array[i].p_sold_num|default:'0' </tpl></td>
          <td align="center" valign="middle" style="text-align:center">
		  <tpl> if $product_array[i].check_sign eq 0 </tpl>
		  	<a href="own_product.php?action=modi&pid=<tpl> $product_array[i].p_code </tpl>" target="_blank"><img src="..<tpl>$templatepath</tpl>/member/images/edititem_bi.gif" title="<tpl> $langCedit </tpl>" alt="<tpl> $langCedit </tpl>" /></a>
		  <tpl> else </tpl>
		  	<img src="..<tpl>$templatepath</tpl>/member/images/edititem_hui.gif" title="<tpl> $langProductIsChecked </tpl>" alt="<tpl> $langProductIsChecked </tpl>" />
		  <tpl> /if </tpl>
		  </td>
        </tr>	 <div style="clear:both"></div>
        <tpl> /section </tpl>
      </table>
	  <tpl> if $product_array[0].p_code neq '' </tpl>
			 <div style="clear:both"></div>
		  <div style="background:#F3F3F3; padding:5px 10px 0px 10px; text-align:left; height:25px">
		  <input style=" font:12px/1.2em '宋体'" name="negative" type="button" id="negative" class="new_anniu" value="<tpl> $langCAllNotSelect </tpl>" />
		  <input style=" font:12px/1.2em '宋体'" type="submit" name="Submit" id="delete"class="new_anniu" value="<tpl> $langCdele </tpl>" />
		  <tpl> if $state == "1" </tpl>
		  <input style=" font:12px/1.2em '宋体'" type="button" name="offsale" id="offsale"class="new_anniu" value="<tpl> $langProductMDownRack </tpl>" />
		  <input type="hidden" name="state" id="state" value="0">
		  <tpl> else </tpl>
		  <input style=" font:12px/1.2em '宋体'" type="button" name="offsale" id="offsale"class="new_anniu" value="<tpl> $langProductMUpRack </tpl>" />
		  <input type="hidden" name="state" id="state" value="1">
		  <tpl> /if </tpl>
		  <tpl> if $action eq 'list' || $action eq 'recommended_list' </tpl>
		  	<input style=" font:12px/1.2em '宋体'" type="button" name="recommended" id="recommended"class="new_anniu1"  value="<tpl> $langRecommended </tpl>" />
			<input style=" font:12px/1.2em '宋体'" type="button"class="new_anniu1"  name="cancel_recommended" id="cancel_recommended" value="<tpl> $langProductMCancelRecommended </tpl>" />
		  <tpl> /if </tpl>
			 <div style="clear:both"></div>
		  </div>
		  	  <div style="float:right; padding:10px">
			<tpl> $page_list </tpl>
			</div>
	  <tpl> else </tpl>
	  	<tpl> $langProductMPrice </tpl>
	  <tpl> /if </tpl>
    </form>
		 <div style="clear:both"></div>
  </div>
   <div style="clear:both"></div>
  </div> <tpl> include file ='../../../html/footer.html' </tpl>
  </div>
</body>
</html>